package demo8;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(Config.class);
        Person person = context.getBean(Person.class);
        System.out.println(person);
        Person person1 = context.getBean(Person.class);
        System.out.println(person1);
        Student student = context.getBean(Student.class);
        System.out.println("1"+student);
        Student student1 = context.getBean(Student.class);
        System.out.println("2"+student1);
        Config config = context.getBean(Config.class);
        System.out.println(config);
        Config config1 = context.getBean(Config.class);
        System.out.println(config1);
        System.out.println(config.initStudent());
    }
}
